// components/common/warehouse-item/index.js
import componentBehavior from '../../../behaviors/component';
import { COMPONENT_OPTIONS } from '../../../constants/common';

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        type: {
            type: String,
            value: 'manage', // manage | select
        },
        checked: {
            type: Boolean,
            value: false,
        },
        warehouseInfo: {
            type: Object,
            value: {},
        },
    },
    methods: {
        handleClick(e) {
            const pos = e.detail;
            const { id } = this.data.warehouseInfo;
            if (pos === 'cell') {
                this.triggerEvent('click', id);
            } else if (pos === 'right') {
                this.triggerEvent('reomve', id);
            }
        },
    }
})
